/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package asa;

/**
 *
 * @author scriptoff
 */
public class ASAInstWhile extends ASAInst {

    private final ASAExpr expr1;
    private final ASAInst bloc;

    public ASAInstWhile(ASAExpr expr1, ASAInst bloc) {
        this.expr1 = expr1;
        this.bloc = bloc;
    }

    @Override
    public void evalue() {
        
        while( expr1.evalue() != 0 ){
            bloc.evalue();
        }
        bloc.liberer();
    }

    @Override
    public ASAExpr getExpr1() {
        return expr1;
    }

    @Override
    public ASAExpr getExpr2() {
        return null;
    }

    @Override
    public String getLabelExplorateur() {
        return "WHILE";
    }
    
}
